Well, logging out is an action, where people don't want to have any of their their...
authorDomas Mituzas <midom@users.mediawiki.org>
Sat, 12 Jan 2008 23:10:08 +0000 (23:10 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Sat, 12 Jan 2008 23:10:08 +0000 (23:10 +0000)
Actually, keeping a session is still bad. And trying to ensure that they don't see cached content... Well, thats wrong idea.
See, if someone is logged out, he is anonymous and deserves to see cached content as everyone else.

So, let's destroy all cookies.

includes/User.php

index 6734c32..c0acf5b 100644 (file)
@@ -1977,12 +1977,13 @@ class User {
                $this->clearInstanceCache( 'defaults' );
 
                $_SESSION['wsUserID'] = 0;
-
+               
                setcookie( $wgCookiePrefix.'UserID', '', time() - 3600, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
                setcookie( $wgCookiePrefix.'Token', '', time() - 3600, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
-
-               # Remember when user logged out, to prevent seeing cached pages
-               setcookie( $wgCookiePrefix.'LoggedOut', wfTimestampNow(), time() + 86400, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
+               setcookie( $wgCookiePrefix.'UserName', '', time() - 3600, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
+               setcookie( $wgCookiePrefix.'LoggedOut', '', time() - 3600, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
+               setcookie( session_name(), '', time() - 3600, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
+               session_destroy();
        }
 
        /**